module BoxModel	

	class FieldSetter
		@@all_fields = []
		@@fields = {}
		
		def fields
			return @@fields
		end
		
		# def all_fields
		# 	return @@all_fields
		# end
		
		def method_missing(method_name, *args)
			# @@all_fields << method_name.to_sym
			@@fields.merge!(method_name.to_sym => args[0])
		end
	end

	def fields(&block)
		raise ArgumentException, 'No Block was passed' unless block_given?
		
		@field_data = FieldSetter.new
		
		@field_data.instance_eval(&block)
	end
	
	def field_data
		return @field_data.fields
	end
	
	# def all_fields
	# 	return @field_data.all_fields
	# end
	
end